Added code to write out the .bmp files embedded in .an1 files.
authorparkrrrr <parkrrrr@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Fri, 25 Mar 2005 16:57:22 +0000 (16:57 +0000)
committerparkrrrr <parkrrrr@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Fri, 25 Mar 2005 16:57:22 +0000 (16:57 +0000)
gpsbabel/intdoc/SA2003_an1_dump.pl

index acf497da19d56276c3cf4b7369d372c7392cfdc0..b38cc9e2c77dd39f65c78fcf5ab4f724fee2e588 100644 (file)
@@ -82,6 +82,17 @@ while ( $bitmapcount ) {
      $size, $xppm, $yppm, $colused, $colimprt ) = shiftunpack( 'lllssllllll');
     # palette
     $palettesize = $bitoffset - $bmisize - 14; # 14 bytes in BMFH, including the 'BM'
+    open BMP, ">bitmap$filecount.bmp";
+    binmode BMP;
+    print BMP 'BM';
+    $head = pack('lssl', ($fhsize,  $res_0_1, $res_0_2, $bitoffset));
+    print BMP $head;
+    $head = pack('lllssllllll', ($bmisize, $width, $height, $planes, $bpp,
+            $compression, $size, $xppm, $yppm, $colused, $colimprt));
+    print BMP $head;
+    print BMP substr($file, 0, $palettesize+$size);
+    close BMP;
+    $filecount++;
     skip_bytes( $palettesize );
     # image
     skip_bytes( $size );